import request from '@/utils/request'

const PurchaseOrderService = {
  // 获取所有进货单
  getAllOrders() {
    return request({
      url: '/purchase-orders',
      method: 'get'
    })
  },

  // 获取进货单详情
  getOrderById(id) {
    return request({
      url: `/purchase-orders/${id}`,
      method: 'get'
    })
  },

  // 创建进货单
  createOrder(data) {
    return request({
      url: '/purchase-orders',
      method: 'post',
      data
    })
  },

  // 更新进货单状态
  updateOrderStatus(id, data) {
    return request({
      url: `/purchase-orders/${id}/status`,
      method: 'patch',
      data
    })
  }
}

export default PurchaseOrderService 